package projectEuler;

public class Problem_02 {

        public static void main(String[] args) {
                int fib[] = new int[1000];
                fib[0] = 1;
                fib[1] = 2;
                int slider = 1;
                do{
                        slider++;
                        fib[slider] = fib[slider-1]+fib[slider-2]; 
                        
                }while(fib[slider] <= 4000000);
                int total = 0;
                for(int count = 0; count < fib.length; count++){
                        if(fib[count]%2 == 0){
                                total = total+fib[count];
                        }
                }
                System.out.println(total);
        }

}